<div class="findtrs" >
	<form action="{:url('usdtError')}" class="layui-inline layui-form" method="post" style="width: 100%;">
		<div class="ftitle">
			<div class="lt">
				<h2>USDT 付款错误申请工单</h2>
			</div>
		</div>
		<div class="fremittanpred fbai" style="height: 500px" >
			<div class="txt">
				{if $error_msg != ''}
				<p style="color: red;font-size: 20px;">Result : {$error_msg}。</p>
				{/if}
			</div>
			<div class="list">
				<ul>
					<li>
						<label>选择对应的充值订单 <i>*</i></label>
						<select name="usdt_history" id="usdt_history" lay-filter="usdt_history" lay-verify="required" lay-verType="tips" style="">
							<option value="">选择对应的充值订单</option>
							{foreach $list_array as $v}
							<option value="{$v.id}">{$v.ctime} , 付款金额:$ {$v.amount_real}</option>
							{/foreach}
						</select>
					</li>
					<li>
						<label>交易 Hash <i>*</i></label>
						<input type="text" class="info" name="trx_hash" id="trx_hash" value="" lay-verify="required" style="border-radius: 0px;height: 38px;" lay-verType="tips" placeholder="请输入交易 Hash" >
					</li>
				</ul>
				<ul>
					<li>
						<label>实际付款金额 <i>*</i></label>
						<input type="text" class="info" name="money" id="money" value="" lay-verify="required" style="border-radius: 0px;height: 38px;" lay-verType="tips" placeholder="请输入付款金额" >
					</li>
					<li>
						<label>实际付款时间 <i>*</i></label>
						<input type="text" class="info" name="time" readonly id="time" value="" lay-verify="required" style="border-radius: 0px;height: 38px;"lay-verType="tips" placeholder="请输入付款时间" >
					</li>
				</ul>
			</div>
			<div class="list">
				<div class="txt">
					<p style="font-size: 13px;"><span style="color: red;">***</span> 请确保填写的 <span style="color: red">'实际付款金额'</span>和<span style="color: red">'实际付款时间'</span> 与链上记录一致.</p>
				</div>
			</div>
			<div class="fbottonlst" style="float: left;padding-top: 10px">
				<ul>
					<li class="on"><input type="submit" class="fsubmit" lay-submit lay-filter="edit" style="float: left" value="提 交" ></li>
					<li><a href="{:url('fund/usdt')}">返回</a></li>
				</ul>
			</div>
		</div>
	</form>

	<div class="funaduibi fbai" >
		<label style="font-size: 20px;width:550px;font-weight: bold">工单日志</label>
		<div class="fdbtable qmfdbtable ftable fboxbai" style="width: auto;">
			<table border="0" cellspacing="0" cellpadding="0" width="100%" id="dataTable1">
			</table>
		</div>
	</div>

</div>

<script type="text/javascript">
	layui.use(['form','table','laydate'], function() {
		var form = layui.form,
			table = layui.table; //表格
		var laydate = layui.laydate;

		// const error_msg = "{$error_msg}";
		// if(error_msg != ''){
		// 	layer.msg("{$error_msg}", {time:1500} ,function () {
		// 		window.location.href = "{:url('fund/usdt')}";
		// 	});
		// }

		laydate.render({
			elem: '#time',
			type: 'datetime',
			format: 'yyyy-MM-dd HH:mm:ss'
		});

		table.render({
			elem: '#dataTable1',
			height: 'auto',
			cellMinWidth: '80',
			totalRow: true,
			method: 'post',
			url: "{:url('usdtReturnLog')}",
			id: 'dataTable1',
			text:{none: '无数据'},
			cols: [[
				{ type: 'numbers'},
				{ field: 'ctime',align: 'center', title: '申请时间',width:180},
				{ field: 'utime',align: 'center', title: '处理时间',width:180},
				{ field: 'amount',  align: 'right', title: '实际付款金额($)',
					style:'color:#FF5722;font-weight:bold',width:180},
				{ align: 'left', title: '处理结果',width:180,
					templet: function (d) {
						const is_ok=d.is_ok;
						var   color = "#6c757d";
						var   show_name = '等待中';
						if(is_ok == 1){
							color = 'green';
							show_name = '已处理';
						}else if(is_ok == 2)
						{
							color = 'red';
							show_name = '处理失败';
						}
						return '<span style="color: ' + color + '">' + show_name + '</span>';
					}
				},
				{ field: 'remark',  align: 'left', title: '描述' },
				{ field: 'trx_hash',  align: 'left', title: '交易hash' },
			]],
			page: true,
			limit: 10,
			limits: [10],
		});
	});
</script>